/**
 * Created by xing on 2017/4/9.
 */
var myarray;
(function(){
    var astr = "[object Array]",
        toString = Object.prototype.toString;

    function isArray(arr){
        return toString.call(arr) === astr;
    }

    myarray = {
        isArray: isArray
    };

    Object.freeze(myarray);

}());

console.log(myarray.isArray([]));
myarray.isArray = null;
console.log(myarray.isArray([]));